package hezi.firebase;

import org.apache.log4j.Logger;

import hezi.core.Post;
import dz.common.Base64;


public class PostS {
	public String runid;
	public String siteid;
	public String forumid;
	public int listindex;
	public int sizeoflist;
	public int seqinlist;
	public String postid;
		
	public String trhtml;
	public String trstring ="";
	public String posttitle;
	public String posturl;
	public String storedposturl;

	public long createtime;
	public long modifytime;
	
	public String healthstate="";//urldup
	public String dupstate="";
	public String statecode="OK";
	
	
//	public PostS() {
//		super();
//	}


	public static PostS convertToPostS(Post post) {
		PostS postS= new PostS();
		
		
		postS.setRunid(post.getRunid());
		postS.setSiteid(post.getSiteid());
		postS.setForumid(post.getForumid());
		postS.setListindex(post.getListindex());
		postS.setSizeoflist(post.getSizeoflist());
		postS.setSeqinlist(post.getSeqinlist());
		postS.setPostid(post.getPostid());
		
		String trhtmlstr = post.getTr().html();
		String encodestr = Base64.encode(trhtmlstr);
		postS.setTrhtml(encodestr);
		
		postS.setTrstring(Base64.encode(post.getTrstring()));
		postS.setPosttitle(Base64.encode(post.getPosttitle()));
		postS.setPosturl(post.getPosturl());
		postS.setStoredposturl(post.getStoredposturl());
		
		postS.setHealthstate(Base64.encode(post.getHealthstate()));
		postS.setDupstate(Base64.encode(post.getDupstate()));
		postS.setStatecode(post.getStatecode());
		
		postS.setCreatetime(post.getCreatetime());
		postS.setModifytime(post.getModifytime());
		
		
		return postS;
	}

	
	
	public String getRunid() {
		return runid;
	}


	public void setRunid(String runid) {
		this.runid = runid;
	}


	public String getSiteid() {
		return siteid;
	}


	public void setSiteid(String siteid) {
		this.siteid = siteid;
	}


	public String getForumid() {
		return forumid;
	}


	public void setForumid(String forumid) {
		this.forumid = forumid;
	}


	public int getListindex() {
		return listindex;
	}


	public void setListindex(int listindex) {
		this.listindex = listindex;
	}


	public int getSizeoflist() {
		return sizeoflist;
	}


	public void setSizeoflist(int sizeoflist) {
		this.sizeoflist = sizeoflist;
	}


	public int getSeqinlist() {
		return seqinlist;
	}


	public void setSeqinlist(int seqinlist) {
		this.seqinlist = seqinlist;
	}


	public String getPostid() {
		return postid;
	}


	public void setPostid(String postid) {
		this.postid = postid;
	}


	public String getTrhtml() {
		return trhtml;
	}


	public void setTrhtml(String trhtml) {
		this.trhtml = trhtml;
	}


	public String getTrstring() {
		return trstring;
	}


	public void setTrstring(String trstring) {
		this.trstring = trstring;
	}


	public String getPosttitle() {
		return posttitle;
	}


	public void setPosttitle(String posttitle) {
		this.posttitle = posttitle;
	}


	public String getPosturl() {
		return posturl;
	}


	public void setPosturl(String posturl) {
		this.posturl = posturl;
	}


	public String getStoredposturl() {
		return storedposturl;
	}


	public void setStoredposturl(String storedposturl) {
		this.storedposturl = storedposturl;
	}


	public long getCreatetime() {
		return createtime;
	}


	public void setCreatetime(long createtime) {
		this.createtime = createtime;
	}


	public long getModifytime() {
		return modifytime;
	}


	public void setModifytime(long modifytime) {
		this.modifytime = modifytime;
	}


	public String getHealthstate() {
		return healthstate;
	}


	public void setHealthstate(String healthstate) {
		this.healthstate = healthstate;
	}


	public String getDupstate() {
		return dupstate;
	}


	public void setDupstate(String dupstate) {
		this.dupstate = dupstate;
	}


	public String getStatecode() {
		return statecode;
	}


	public void setStatecode(String statecode) {
		this.statecode = statecode;
	}
	
	
	public static Logger logger = Logger.getLogger("");
	



}
